package com.neusoft.Controller;

import com.neusoft.po.Dept;
import com.neusoft.po.ResponseBean;
import com.neusoft.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/dept")
@RefreshScope   // 开启动态刷新
public class DeptController {

    @Autowired
    private DeptService ds;

    @GetMapping("/getDeptByNo/{deptno}")
    public ResponseBean<Dept> getDeptByNo(@PathVariable Integer deptno){
        return ds.getDeptByNo(deptno);
    }
}
